package com.goldcn.goods.dao;

import com.goldcn.goods.dto.GoodsSkuDto;
import com.goldcn.goods.dto.QueryGoodsSkuRateDto;
import com.goldcn.goods.model.GoodsSku;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface GoodsSkuMapper {

    GoodsSku selectByPrimaryKey(Long skuID);

    int insertBatch(List<GoodsSku> record);

    List<GoodsSku> selectByGoodsID(Long goodsID);

    /**
     * 带会员价
     * @param goodsID
     * @param vipLevel
     * @return
     */
    List<GoodsSku> selectByGoodsIDv2(@Param("goodsID")Long goodsID,@Param("vipLevel")Long vipLevel);


    List<GoodsSku> selectShopByGoodsID(@Param("goodsID")Long goodsID,@Param("shopID")Long shopID);


    int deleteByGoodsID(Long skuID);

    int updateByPrimaryKeySelective(GoodsSkuDto goodsSkuDto);

    int addInventoryBySkuID(@Param("skuID") Long skuID, @Param("number") Integer number);

    int subtractInventoryBySkuID(@Param("skuID") Long skuID, @Param("number") Integer number);

    //List<QueryGoodsSkuRateDto> selectGoodsSkuRate(List<Long> list);
    QueryGoodsSkuRateDto selectGoodsSkuRate2(Long skuID);

    QueryGoodsSkuRateDto selectGoodsSkuRateBySkus(@Param("skuID")Long skuID,@Param("sellerID") Long sellerID);

    QueryGoodsSkuRateDto selectGoodsSkuRateBySkus2(@Param("skuID")Long skuID,@Param("shopID") Long shopID);

    List<Long> selectByGoodsCompanyID(Long companyID);

    int deleteByList(List<Long> skuIDs);

    int updateByPrimaryKeySelective2(GoodsSku record);
}